<template>
  <div class="home-banner">
    <XtxSlider :sliders="bannerList" />
  </div>
</template>

<script>
import { findBanner } from '@/api/home'
import { ref } from 'vue'
export default {
  name: 'HomeBanner',
  // setup不能用saync来修饰
  setup() {
    const bannerList = ref([])

    // 参数修改
    // ajax
    findBanner().then(res => {
      bannerList.value = res.result
    })

    return {
      bannerList
    }
  }
}
</script>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 450px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
